package com.geline.demo.dto;

import com.alibaba.excel.annotation.ExcelProperty;
import com.geline.easyexcel.annotation.ExcelDropDown;
import com.geline.easyexcel.annotation.ExcelExportPage;
import com.geline.easyexcel.annotation.ExcelImport;
import com.geline.easyexcel.annotation.ExcelValid;
import com.geline.easyexcel.domain.DropDownType;
import com.geline.easytrans.annotation.TransDict;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Schema(description = "城镇房屋数据项")
@ExcelImport(value = "townHouse")
@ExcelExportPage(value = "townHouse", templateFile = "file:excel/townHouse.xlsx")
@Getter
@Setter
public class TownHouseVO implements Serializable {

    @ExcelProperty(value = "房屋编号", index = 0)
    private String fwjzdm;

    @Schema(description = "房屋类别")
    @TransDict(dictType = "house_category", source = "fwlbLabel")
    private String fwlb;

    @ExcelProperty(value = "房屋类别", index = 1)
    @ExcelDropDown(index = 1, dictName = "房屋类别", dictCode = "house_category")
    @TransDict(dictType = "house_category", source = "fwlb")
    private String fwlbLabel;

    @TransDict(dictType = "town_structure_type_2", source = "jglxLabel")
    private String jglx;

    @ExcelProperty(value = "结构类型", index = 2)
    @ExcelDropDown(index = 2, dictName = "城镇房屋结构类型", dictCode = "town_structure_type", dictLevel = 1, type = DropDownType.SELECT)
    @TransDict(dictType = "town_structure_type_2", source = "jglx")
    private String jglxLabel;

    @Schema(description = "二级结构类型")
    @TransDict(dictType = "town_structure_type_3", source = "ecjglxLabel")
    private String ecjglx;

    @ExcelProperty(value = "二级结构类型", index = 3)
    @ExcelDropDown(index = 3, dictName = "二级结构类型", dictCode = "town_structure_type", dictLevel = 2, type = DropDownType.CASCADE, parentIndex = 2)
    @TransDict(dictType = "town_structure_type_3", source = "ecjglx")
    private String ecjglxLabel;

    @ExcelProperty(value = "建筑名称", index = 4)
    @ExcelValid(notBlank = true, length = 50)
    private String jzmc;

}
